package com.daodao.daodaoschedule.domain.wechat;

import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author mal
 * @date 2023-02-15 14:32
 */
@Data
public class WechatAccount {
    private Long id;

    private String wechatOriginId;

    private String appId;

    private String appSecret;

    private String accessToken;

    private LocalDateTime expireTime;


    public void updateAccessToken(String accessToken, Integer expiresIn) {
        this.accessToken = accessToken;
        this.expireTime = LocalDateTime.now().plusSeconds(expiresIn - 60);
    }
}
